'use strict';
var app = angular.module('loginApp', []);
app.controller('loginCtrl', function($scope, $http) {
	$scope.loginin = function() {
		var username = $('#username').val();
		var pass = $('#pass').val();
		$http.get(baseUrl + '/userLogin?username=' + username + '&password='
				+ pass).success( function (data) {
		
			if(data.success == true){
				window.location.href=baseUrl+'/index.jsp'
			}else
				{
				$('#loginValid').text(data.msg);
				$('#pass').val("");
				$('#loginValid').css("display","block");
				}

		});
	};
});